home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / ncclib.zip / NCCDEMO.ZIP / G_MENU.PRG < prev    next >
Text File  |  1992-11-03  |  5KB  |  94 lines

  1. //═══════════════════════════════════════════════════════╕
  2. //  Program .....: G_Menu                                │
  3. //  CopyRight ...: 1992 National Computer Consultants    │
  4. //                 All rights are reserved.              │
  5. //  Author ......: Greg Rice                             │
  6. //═══════════════════════════════════════════════════════╛
  7.  
  8.  
  9. #include "g_menu.ch"
  10. #include "inkey.ch"
  11.  
  12. Function g_menu()
  13.  
  14.     local Bar
  15.  
  16.  
  17.     Bar := NccBar():New(1)
  18.  
  19.     Bar:MouseActive := .t.
  20.  
  21.     Bar:AddMenuPrompt( ABOUT , ' ≡ '        ) ; Bar:PromptSubMenu( ABOUT ,  Menu_(0, Bar) )
  22.     Bar:AddMenuPrompt( FILE , ' File '     ) ; Bar:PromptSubMenu( FILE ,  Menu_(1, Bar) )
  23.     Bar:AddMenuPrompt( INDEX , ' Index '    ) ; Bar:PromptSubMenu( INDEX ,  Menu_(2, Bar) )
  24.     Bar:AddMenuPrompt( VIEW , ' Fi~elds '   ) ; Bar:PromptSubMenu( VIEW ,  Menu_(3, Bar) )
  25.     Bar:AddMenuPrompt( POSITION , ' Record ' ) ; Bar:PromptSubMenu( POSITION ,  Menu_(5, Bar) )
  26.     Bar:AddMenuPrompt( WINDOW , ' Window '   ) ; Bar:PromptSubMenu( WINDOW ,  Menu_(6, Bar) )
  27.     Bar:AddMenuPrompt( HELP , ' Help '     ) ; Bar:PromptSubMenu( HELP ,  Menu_(8, Bar) )
  28.  
  29.     Bar:PromptQuickKey( CHANGE_RECORD , K_ENTER )
  30.     Bar:PromptQuickKey( VIEW_MODIFY   , K_ALT_L )
  31.     Bar:PromptQuickKey( WIN_MOVE      , K_ALT_M )
  32.     Bar:PromptQuickKey( SYS_EXIT      , K_ALT_X )
  33.     Bar:PromptQuickKey( WIN_ZOOM      , K_ALT_Z )
  34.  
  35.     Bar:PromptQuickKey( INDEX_REORDER , K_CTRL_H )
  36.  
  37. Return( Bar )
  38.  
  39.  
  40. static Function Menu_( x, Bar )
  41.  
  42.     local m, s
  43.  
  44.  
  45.     m := NccMenu():New
  46.     m:Shadow       := .t.
  47.     m:Border       := 4
  48.     m:LetterColor  := Bar:LetterColor
  49.  
  50.     Do Case
  51.       Case x == 0
  52.         m:AddPrompt( ABOUT_ABOUT , ' About ' )                                            ; m:PromptMessage( , 'About the NCC Demo' )
  53.  
  54.       Case x == 1
  55.         m:AddPrompt( DATABASE_NEW     , ' New...', .f. )                           ; m:PromptMessage( , 'Create a New Database File'  )
  56.         m:AddPrompt( DATABASE_OPEN    , ' Open...                F' )              ; m:PromptMessage( , 'Open a Database File' )
  57.         m:AddPrompt( DATABASE_CLOSE   , ' Close' )                                 ; m:PromptMessage( , 'Close Database File' )
  58.         m:AddPromptLine()
  59.  
  60.  
  61.         m:AddPrompt( SYS_EXIT, ' e~Xit               Alt-X' ) ; m:PromptMessage( , 'Quit NCC Demo...' )
  62.  
  63.       Case x == 2
  64.         m:AddPrompt( INDEX_OPEN     , ' Open...                           I' )     ; m:PromptMessage( , 'Open a Existing Index' )
  65.         m:AddPrompt( INDEX_CLOSE    , ' Close...' )                                ; m:PromptMessage( , 'Close all Index files' )
  66.         m:AddPromptLine()
  67.         m:AddPrompt( INDEX_REORDER  , ' c~Hange index order...        Ctrl-H' )    ; m:PromptMessage( , 'Change Controlling Index order' )
  68.  
  69.       Case x == 3
  70.         m:AddPrompt( VIEW_MODIFY  , ' modify field ~List...   Alt-L' )             ; m:PromptMessage( , 'Modify Fields in Window')
  71.         m:AddPromptLine()
  72.         m:AddPrompt( VIEW_VERT       , ' Vertical records' )                       ; m:PromptMessage( , 'Display records in a Vertical format' )
  73.         m:AddPrompt( VIEW_HORI       , ' Horizontal records' )                     ; m:PromptMessage( , 'Display records in a Horizontal format' )
  74.  
  75.  
  76.       Case x == 5
  77.         m:AddPrompt( GO_REC          , ' Go to record...  G' )                     ; m:PromptMessage( , 'Go to specific record' )
  78.         m:AddPrompt( LOCA_REC        , ' Locate...        L' )                     ; m:PromptMessage( , 'Locate a record based on a locate command' )
  79.         m:AddPrompt( SEEK_REC        , ' Seek...          S' )                     ; m:PromptMessage( , 'Seek a record based on an Index condition' )
  80.  
  81.       Case x == 6
  82.         m:AddPrompt( WIN_NEXT        , ' Next                Tab' )                ; m:PromptMessage( , 'Change to next window by mouse or keyboard' )
  83.         m:AddPrompt( WIN_PREV        , ' Previous      Shift-Tab' )                ; m:PromptMessage( , 'Change to previous window by mouse or keyboard' )
  84.         m:AddPrompt( WIN_MOVE        , ' Move/resize       Alt-M' )                ; m:PromptMessage( , 'Change window coordinates or position by mouse or keyboard' )
  85.         m:AddPrompt( WIN_ZOOM        , ' Zoom              Alt-Z' )                ; m:PromptMessage( , 'Toggle between Full screen and default size window' )
  86.  
  87.       Case x == 8
  88.         m:AddPrompt( HELP_GEN        , ' Help ' )                               ; m:PromptMessage( , 'Help on this Demo' )
  89.         m:AddPrompt( HELP_WIN        , ' Window Help' )                                   ; m:PromptMessage( , 'Keys in the system' )
  90.  
  91.     EndCase
  92.  
  93. Return( m )
  94.